// 引入数据库模块
const mongoose = require('mongoose');

mongoose.connect('mongodb://localhost/blog', { useNewUrlParser: true, useUnifiedTopology: true })
.then(() => {console.log('连接数据库成功')})
.catch(err => console.log(err, '数据库连接失败'))
